package edu.ynu.se.xiecheng.achitectureclass.Demo1.entity;

import edu.ynu.se.xiecheng.achitectureclass.common.entity.LogicEntity;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.time.LocalDateTime;

@Entity
@Getter
@Setter
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "data_type", discriminatorType = DiscriminatorType.STRING)
@Where(clause = "is_deleted = 0")
public abstract class DeviceData extends LogicEntity {
    @Column
    private String name; // 数据名称

    @Column
    private Double value; // 数据值

    @Column
    private String unit; // 单位

    @Column
    private LocalDateTime createdTime; // 数据记录时间

    @Column
    private String deviceId; // 设备ID

    @Column
    private Integer status; // 数据状态

    @Column
    private Integer connState; // 连接状态

    @Column
    private LocalDateTime connStateTimestamp; // 连接状态时间戳
}
